﻿using UnityEngine;
using System.Collections;

public class CloseStart : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
		if(Time.timeSinceLevelLoad > 1f)
			return;
			
		Vector3 pos1 = GameObject.FindGameObjectWithTag("Player").transform.position;
		Vector3 pos2 = transform.position;
		
		pos1.z=0f;
		pos2.z=0f;
		
		if(Vector2.Distance(pos1,pos2) < 10f)
			Destroy (gameObject);
	}

}
